def shiheyong():
    words = input("请输入字符串:" + "\n").split(",")
    s = input("请输入一个字符串:" + "\n")
    st = ""
    i = 0
    for b in s:
        if i >= len(words):
            return False
        if b == words[i][0]:
            i += 1
            st += b
    return st == s


print(shiheyong())
